package com.hdf.etdemo.view.gridview;
import com.hdf.easytools.base.EasyToolsActivity;
import com.hdf.easytools.view.grdiview.HeaderGridView;
import com.hdf.easytools.view.viewpage.CycleViewPager;
import com.hdf.easytools.view.viewpage.ViewFactory;
import com.hdf.etdemo.R;
import com.hdf.etdemo.uitl.DemoUtil;
import com.hdf.etdemo.view.listview.adapter.GridViewAdapter;
import android.os.Bundle;
import android.view.View;


public class HeadGridViewActivity extends EasyToolsActivity {
	private HeaderGridView gridview;
	private CycleViewPager cycleViewPager;
	private View vhdf;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_head_grid_view);
		/**设置标题显示*/
		this.TitleVisib(0, 1, 1, 0, 0);
		/**绑定标题点击事件*/
		this.TitleClick(0, 1, 0, 0, 0);
		/**设置标题样式ʽ*/
		this.TitleStyle(null,R.drawable.et_back, "可以添加头部的GridView", null,0);
		gridview=(HeaderGridView) findViewById(R.id.gridview);
		gridview.setNumColumns(2);
		gridview.setVerticalSpacing(30);
		vhdf = getLayoutInflater().inflate(R.layout.viewpage, null);
		cycleViewPager = (CycleViewPager) getFragmentManager().findFragmentById(R.id.fragment_cycle_viewpager_content);
		ViewFactory.initialize(this, vhdf, cycleViewPager, DemoUtil.cycData());
		gridview.addHeaderView(vhdf);
		gridview.setAdapter(new GridViewAdapter(this, DemoUtil.demoData()));
	}


	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
		case R.id.left_img:
				finish();
			break;
		default:
			break;
		}
	}
	
}
